package com.bjpowernode.validator.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * ClassName:Employee
 * Package:com.bjpowernode.validator.pojo
 * Description: 描述信息
 *
 * @date:2022/3/19 14:37
 * @author:动力节点
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Employee {
    public interface Add{}
    public interface Update{}

    @Null(groups = {Add.class})        //在添加是生效
    @NotNull(groups = Update.class)    //在修改的时候生效
    private Integer id;
    @NotEmpty
    private String name;
    @Valid
    private Department department;

}
